/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ourgame.tankgame.control;

import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.AnalogListener;
import com.jme3.scene.control.AbstractControl;

/**
 * 抽象的移动系统，用来使坦克能动
 * @author echoff
 */
public abstract class MoveSystem extends AbstractControl implements ActionListener, AnalogListener {
    protected float maxHorsepower;//发动机最大输出功率
    protected float maxTurnRadius;//最大转弯半径
    protected ControlSystem controler;
//    protected PhysicsControl physicsControl;//使用的轮子系统


    //********************************************************
    //*      get、set 区域                                    *
    //********************************************************
    
//    public PhysicsControl getPhysicsControl() {
//        return physicsControl;
//    }
//
//    public void setPhysicsControl(PhysicsControl physicsControl) {
//        this.physicsControl = physicsControl;
//    }

    public float getMaxHorsepower() {
        return maxHorsepower;
    }

    public void setMaxHorsepower(float maxHorsepower) {
        this.maxHorsepower = maxHorsepower;
    }

    public float getMaxTurnRadius() {
        return maxTurnRadius;
    }

    public void setMaxTurnRadius(float maxTurnRadius) {
        this.maxTurnRadius = maxTurnRadius;
    }
    //********************************************************
    //*      功能方法区域                                     *
    //********************************************************

    public void onAction(String name, boolean isPressed, float tpf) {
        //TODO own action
    }

    public void onAnalog(String name, float value, float tpf) {
        //TODO own action
    }
    
    public abstract void initMoveSystem();
    
    /**
     * 给控制器调用使得坦克前进
     */
    public abstract  void moveAhead(boolean isPressed);
    /**
     * 给控制器调用使得坦克后退
     */
    public abstract  void moveBack(boolean isPressed);
    /**
     * 给控制器调用使得坦克右转
     */
    public abstract void turnRight(boolean isPressed);
    /**
     * 给控制器调用使得坦克左转
     */
    public abstract void turnLeft(boolean isPressed);
    /**
     * 给控制器调用使得坦克刹车
     */
    public abstract void brake(boolean isPressed);

    /**
     * @param controler the controler to set
     */
    public void setControler(ControlSystem controler) {
        this.controler = controler;
    }
}
